<template>
  <view class="goods-item">
    <view class="goods-img">
      <image :src="goods.goods_small_logo" style="width: 100%;" mode="widthFix"></image>
    </view>
    <view class="goods-info">
      <view class="goods-text">{{goods.goods_name}}</view>
      <view class="goods-price">￥{{goods.goods_price  | price}}</view>
    </view>
  </view>
</template>

<script>
  export default {
    name:"myGoods",
    props:{
      goods:{
        type:Object,
        default:{}
      }
    },
    filters:{
      // 商品价格
      price(num){
        return num === 0 ? 999.99 : Number(num).toFixed(2)
      }
    },
    data() {
      return {
        
      };
    }
  }
</script>

<style lang="scss">
.goods-item{
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 10px;
    background-color: white;
    .goods-info{
      
      .goods-text{
        font-size: 12px;
        margin: 5px;
      }
      .goods-price{
        color: red;
        margin-bottom: 5px;
        margin-left: 5px;
      }
    }
    
  }
</style>